package com.yjzx.core.bean.sql;

import com.yjzx.core.bean.DataInfo;

import java.util.List;

/**
 * @author guozhi
 * @date 2023/10/19
 * @description SqlClassInfo
 */
public abstract class SqlClassInfo implements DataInfo {


    /***
     * 表名
     */
    private String tableName;

    /**
     * class类名
     */
    private String className;

    /**
     * class实体参数名 如: classInfo
     */
    private String modelName;

    /**
     * class注释
     */
    private String classComment;

    /***
     * 主键字段及值 (默认以持有字段的 index=0 为主键)
     */
    private FieldInfo key;

    /**
     * 持有字段
     */
    private List<FieldInfo> fieldList;

    @Override
    public SqlClassInfo getData() {
        return this;
    }

    public SqlClassInfo() {
    }

    public SqlClassInfo(String tableName, String className, String modelName, String classComment, FieldInfo key, List<FieldInfo> fieldList) {
        this.tableName = tableName;
        this.className = className;
        this.modelName = modelName;
        this.classComment = classComment;
        this.key = key;
        this.fieldList = fieldList;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getModelName() {
        return modelName;
    }

    public void setModelName(String modelName) {
        this.modelName = modelName;
    }

    public String getClassComment() {
        return classComment;
    }

    public void setClassComment(String classComment) {
        this.classComment = classComment;
    }

    public FieldInfo getKey() {
        return key;
    }

    public void setKey(FieldInfo key) {
        this.key = key;
    }

    public List<FieldInfo> getFieldList() {
        return fieldList;
    }

    public void setFieldList(List<FieldInfo> fieldList) {
        this.fieldList = fieldList;
    }
}
